<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/common/dtbd/header.jsp" %>
<link rel="stylesheet" href="<common:webRoot />/resources/platform/render/seeAndPrint.css" />
<style>

</style>
</head>
<body style="overflow: scroll;" ng-init="dynamic={XH:'${recordId}'};isPrint = ${empty recordId ? false:true} ;YWLCDYBH='${empty YWLCDYBH ? '' : YWLCDYBH}';bbxh='${bbxh }';
        businessId='${empty businessId ? '' : businessId}';businessXH='${empty businessXH ? '' : businessXH}';isReadOnly=${empty isView ? false:isView};
        ACTIONID='${empty ACTIONID ? '' : ACTIONID}';BZBH='${empty BZBH ? '' : BZBH}';BZDYBH='${empty BZDYBH ? '' : BZDYBH}';paramOne='${empty paramOne ? '' : paramOne}';paramTwo='${empty paramTwo ? '' : paramTwo}';
        paramThree='${empty paramThree ? '' : paramThree}'" >
<%--添加 id = 'dynamicController' 为显示隐藏字段 --%>
<div class="container-full"  id = 'dynamicController'  ng-controller="dynamicController as ctrl">
    <div id="content">
    </div>
    <div id="childLayer">
    </div>
</div>
</body>
<%-- 
<script type="text/javascript" src="<common:webRoot />/resources/platform/common/component/pageoffice/pageoffice.js?v=20160630"></script> --%>
<script>
    var jsCodeStr = ${empty DYNACODE ? '""' : DYNACODE};
    var currentUser = ${currentUser};
    var externalFile = ${empty WBWJ ? '""' : WBWJ};

    if(externalFile && externalFile.length>0){

        for(var i = 0;i<externalFile.length;i++){
            var filePath = externalFile[i];
            if(filePath.EXTERNALJS){
                var script=document.createElement("script");
                script.type="text/javascript";
                script.src= Common.webRoot()+filePath.EXTERNALJS;
                document.getElementsByTagName('head')[0].appendChild(script);
            }
            if(filePath.EXTERNALCSS){
                var link = document.createElement('link');
                link.type = 'text/css';
                link.rel = 'stylesheet';
                link.href =  Common.webRoot()+filePath.EXTERNALCSS;;
                var head = document.getElementsByTagName('head')[0];
                head.appendChild(link);
            }
        }
    }
</script>
<script type="text/javascript" src="<common:webRoot />/resources/dynamicform/viewresolver/js/dynamic-resolver-ext.js?v=${sysversion}"></script>
<script type="text/javascript" src="<common:webRoot />/resources/dynamicform/power-ui/dynamic-form/dynamic-resolver.js?v=${sysversion}"></script>
<script type="text/javascript" src="<common:webRoot />/resources/dynamicform/power-ui/dynamic-form/dynamic-form.js?v=${sysversion}"></script>
<script type="text/javascript" src="<common:webRoot />/resources/dynamicform/power-ui/components/easyui.init.js?v=${sysversion}"></script>
<script type="text/javascript" src="<common:webRoot />/resources/diyfile/diyfile.js?v=${sysversion}"></script>
<%@include file="/common/dtbd/footer.jsp" %>

<!-- 表单公共组件步骤 -->
<script id="formCommon" type="text/html">
    <div class="row" id="detail">
        <div class="col-xs-12 row">
            <div class="edit-header">
                <div class=" col-xs-4 edit-title">
                    <#if(BDBT){#>
                    <i class="iocn"></i>
                    <i><#=BDBT#></i>
                    <#}#>
                </div>
                <!-- 标题右侧按钮 开始 -->
                <div class="col-xs-8 edit-btn-box">
                    <#
                    if(btns.length>0){
                    for(var i in btns){

                    var readOnly = false;
                    if(btns[i].SFZD){
                    readOnly =  (btns[i].SFZD =="1");
                    }
                    if(typeof btns[i].readonly != 'undefined' && btns[i].readonly){
                    readOnly = btns[i].readonly;
                    }

                    if(btns[i].isshow == '0'){
                    continue;
                    }
                    if(btns[i].attributeChildValue == 'saveAndStartWorkflow'){
                    #>
                    <button ng-hide="buttons.<#=btns[i].attributeChildValue#>" ng-if="saveAndStartWorkflow && (!dynamic.BWBH&&YWLCDYBH)&&!(<#=readOnly#>||isView)" ng-disabled="<#=readOnly#>||isView" type="button"  class="btn btn-default btn-sm send"  ng-click="ctrl.events.buttonClick('<#=btns[i].attributeChildValue#>')"><#=btns[i].attributeChildName#></button>
                    <#
                    }else if(btns[i].attributeChildValue == 'save'){
                    #>
                    <button ng-hide="buttons.<#=btns[i].attributeChildValue#>"  type="button" ng-if="save && !(<#=readOnly#>||isView)" ng-disabled="<#=readOnly#>||isView"  class="btn btn-default btn-sm save"  ng-click="ctrl.events.buttonClick('<#=btns[i].attributeChildValue#>')"><#=btns[i].attributeChildName#></button>
                    <#
                    }else if(btns[i].attributeChildValue == 'print'){
                    #>
                    <button ng-hide="buttons.<#=btns[i].attributeChildValue#>" ng-if="isPrint" ng-if="!(<#=readOnly#>||isView)" ng-disabled="<#=readOnly#>||isView" type="button" class="btn btn-default btn-sm"  ng-click="ctrl.events.buttonClick('<#=btns[i].attributeChildValue#>')"><#=btns[i].attributeChildName#></button>
                    <#
                    }else if(btns[i].attributeChildValue == 'printView'){
                    #>
                    <button ng-hide="buttons.<#=btns[i].attributeChildValue#>" ng-if="isPrint" ng-if="!(<#=readOnly#>||isView)" ng-disabled="<#=readOnly#>||isView" type="button" class="btn btn-default btn-sm"  ng-click="ctrl.events.buttonClick('<#=btns[i].attributeChildValue#>')"><#=btns[i].attributeChildName#></button>
                    <#
                    }else if(btns[i].attributeChildValue == 'wordPrint'){
                    #>
                    <button ng-hide="buttons.<#=btns[i].attributeChildValue#>" ng-if="dynamic.XH" type="button" class="btn btn-default btn-sm export"  ng-click="ctrl.events.buttonClick('<#=btns[i].attributeChildValue#>')"><#=btns[i].attributeChildName#></button>
                    <#
                    }else{
                    #>
                    <button type="button" ng-hide="buttons.<#=btns[i].attributeChildValue#>" ng-if="!(<#=readOnly#>||isView)" ng-disabled="<#=readOnly#>||isView" class="btn btn-default btn-sm <#=btns[i].attributeChildContent#>" ng-click="ctrl.events.buttonClick('<#=btns[i].attributeChildValue#>')"><#=btns[i].attributeChildName#></button>
                    <#          }
                    }
                    }else{
                    #>
                    <!-- <button ng-if="isPrint" type="button"  class="btn btn-default btn-sm" ng-click="ctrl.events.print()">打&nbsp;印</button> -->
                    <button ng-hide="buttons.save"  type="button" ng-disabled="isReadOnly||isView"  ng-if="!YWLCDYBH&&!(isReadOnly||isView)" class="btn btn-default btn-lg save" ng-click="ctrl.events.buttonClick('save')">保&nbsp;存</button>
                    <button ng-hide="buttons.saveAndStartWorkflow" ng-disabled="isReadOnly||isView" ng-if="(!dynamic.BWBH&&YWLCDYBH)&&!(isReadOnly||isView)" type="button"   class="btn btn-default btn-lg save" ng-click="ctrl.events.buttonClick('saveAndStartWorkflow')" >发起流程</button>
                    <#
                    }
                    #>
                    <button ng-if="showWorkbeanch||dynamic.BZBH"  type="button"  ng-show="YWLCDYBH" class="btn btn-default btn-sm save" ng-click="ctrl.events.buttonClick('showWorkbeanch')">流转</button>
                </div>
                <!-- 标题右侧按钮 结束 -->
            </div>
        </div>
    </div>
    <div class="pt10 power-edit-body">
        <form class="form-horizontal" name="validateForm">
</script>

<!-- 子表弹出框公共组件步骤 -->
<script id="formCommonChild" type="text/html">
    <div class="row" id="detail">
        <div class="col-xs-12">
            <div class="edit-header">
                <div class="col-xs-4 edit-title">
                    <i class="iocn"></i>
                    <i><#=templateName #></i>
                </div>
                <div class="col-xs-8 edit-btn-box">
                    <div ng-if="!isView&&!isReadOnly" class="power-btn power-btn-default" ng-click="ctrl.events.saveOrUpdateChildLayer('<#=type#>','<#=rowIndex#>')">暂&nbsp;存</div>
                </div>
            </div>
        </div>
    </div>
    <div class="pt10 power-edit-body">
        <form class="form-horizontal" name="validateForm">
</script>

<!-- 表单解析部分 -->
<script id="formBaseTpl" type="text/html">
    <!--递归迭代 -->
    <#
    var isGroup = title ? true  :false;
    #>
    <#if(isGroup){ #>
    <table class="form-table-child" >
        <tr>
            <td class="form-lable td-title" colspan="4">
                <span class="form-td-title-circle"></span>
                <#=title#>
            </td>
        </tr>
    </table>
    <#}#>
    <table class="form-table form-table-<#=struStrObj.templateTable#> <#if(isGroup){#>form-table-child<#}#>"  form-table-name="<#=struStrObj.templateTable#>" ng-class="{'disabled':isView||isReadOnly}" >
        <tbody>
        <#
        //j是用来遍历结构的
        var j = 0;
        var isFileUpload = false;
        var fileUploadtype = 'upload-file-list';
        var  list  =  struStrObj.child;
        for(var i=0;i<list.length;i++){
        if(list[i].isshow == '0'){
        continue;
        }
        //附件上传
        if(list[i].datasource == 'FILE_UPLOAD' || list[i].type == 'ATTACH_ELEMENT' ){
        fileUploadtype = list[i].uploadFileType ?  list[i].uploadFileType : "upload-file-list";
        isFileUpload = true;
        //continue;
        }
        //默认子表 增加问答表单方式
        if(list[i].resovletype == 'commonForm' || list[i].resovletype == 'questionsAnswersForm'){
        #>
        <#-dynamicResolver.childTableFormResolver("commonFormChild",
        {dynamicResolver:dynamicResolver,formInfo:list[i],MAX_CHILD_COLUMN:MAX_CHILD_COLUMN})#>
        <table class="form-table table-append  form-table-<#=struStrObj.templateTable#>" ng-class="{'disabled':isView||isReadOnly}">
            <#
            if(j%2!=0){
            j=0;
            }
            continue;
            }
            //基础平台4子表
            if(list[i].resovletype == 'platform4'){#>
            <#-dynamicResolver.childTableFormResolver("platform4SecondChild",
            {dynamicResolver:dynamicResolver,formInfo:list[i],MAX_CHILD_COLUMN:MAX_CHILD_COLUMN})#>
            <table class="form-table table-append form-table-<#=struStrObj.templateTable#>" ng-class="{'disabled':isView||isReadOnly}">
                <#
                if(j%2!=0){
                j=0;
                }
                continue;
                }
                if(list[i].type == 'group'){
                #>
                <#-me.render("formBaseTpl",list[i].child,dynamicResolver,list[i].name) #>
                <#
                if(j%2!=0){
                j=0;
                }
                continue;
                }
                //标题类型
                if(list[i].type == 'TITLE_ELEMENT'
                ){
                #>
                <tr>
                    <td class="form-lable td-title"  colspan="4" style="padding: 8px" name="<#=list[i].YSMC #>">
                                <span class="form-td-title-circle">
                                </span>
                        <#=list[i].label #>
                        <!- 提示框 ->
                        <#if(list[i].explain){#>
                        <power-tip position="left" icon="fa fa-info-circle" content="<#=list[i].explain#>" size="1"></power-tip>
                        <#}#>
                    </td>
                <tr>
                    <#
                    continue;
                    }
                    #>
                    <#if(!list[i].xsgs || list[i].xsgs=="1" || (list[i].xsgs =="2" && j%2==0)){ #><!-- 显示格式 -->
                <tr>
                    <#}#>
                    <#if( (list[i].ISSHOWLABEL&&'true'==list[i].ISSHOWLABEL)
                    ){
                    #>

                    <td ng-hide="<#=list[i].rowspans>1#>" class="form-lable <#=list[i].dbcolum+'_labelTh'#> td-label"   ng-class="{'disabled':isView||isReadOnly}" >
                        <#-list[i].must&&list[i].must=='1' ? "<i class='pd-required'>*</i>" : "" #>
                        <!- 提示框 ->
                        <#if(list[i].explain){#>
                        <power-tip position="left" icon="fa fa-info-circle" content="<#=list[i].explain#>" size="1"></power-tip>
                        <#}#>
                        <span style = 'color : red;' class="ng-hide" ng-hide="isShowColum" ><#=(list[i].dbcolum).toLowerCase() #></span><#=list[i].label #>：
                    </td>
                    <#
                    }
                    #>
                    <!-- 描述组件默认不显示label -->
                    <#
                    if((list[i].ISSHOWLABEL&&'true'==list[i].ISSHOWLABEL)
                    ){
                    #>
                    <td align="<#=list[i].ALIGN#>" <#-list[i].rowspans>1 ? "rowspan="+list[i].rowspans : "" #> class="<#=list[i].dbcolum+'_valueTd' #> td-value" <#if(!list[i].xsgs || list[i].xsgs=="1"){ #>colspan="7" <#}else if(list[i].xsgs=="2"){#>colspan="3" <#}else{#>colspan="1" <#}#> class='<#if(isGroup){#>p0<#}#>'>
                    <#
                    } else {
                    #>
                    <td align="<#=list[i].ALIGN#>" <#-list[i].rowspans>1 ? "rowspan="+list[i].rowspans : "" #> class="<#=list[i].dbcolum+'_valueTd' #> td-value" <#if(!list[i].xsgs || list[i].xsgs=="1"){ #>colspan="8" <#}else if(list[i].xsgs=="2"){#>colspan="4" <#}else{#>colspan="2" <#}#> class='<#if(isGroup){#>p0<#}#>'>
                    <#
                    }
                    #>
                    <!-- 开始解析组件 -->
                    <# if(isChildItem){list[i].isChildItem=true} #>

                    <div elementid="<#=list[i].id#>" class="main-form-element<#=i#>  <#if(list[i].bootstrap_col&&list[i].bootstrap_col!='empty'){#>row <#=list[i].bootstrap_col #><#}#>" >

                        <#-dynamicResolver.commpResolver(list[i])#>
                    </div>
                    <!-- 结束解析组件 -->
                    </td>
                    <#if(!list[i].xsgs || list[i].xsgs=="1" || (list[i].xsgs =="2" && j%2!=0)){#>
                </tr>
                <#}#>
                <# if(isFileUpload){#>
                <tr>
                    <td colspan="8" style="border-top: none;border-bottom: none;padding: 10px 0px;">
                        <!--附件上传1111 -->
                        <div class="row upload-wrap">
                            <div class="col-xs-12">
                                <# if(fileUploadtype=='upload-picture'){#>
                                <div upload-picture ng-config="uploadConfig_<#=i#>" ng-uploader="uploader"></div>
                                <#} else if(fileUploadtype=='upload-file-simplify'){#>
                                <div upload-file-simplify ng-config="uploadConfig_<#=i#>" ng-uploader="uploader"></div>
                                <#} else{#>
                                <div upload-file-list ng-config="uploadConfig_<#=i#>" ng-uploader="uploader"></div>
                                <#}#>
                            </div>
                        </div>
                    </td>
                </tr>
                <# isFileUpload = false; }#>
                <#
                if(!list[i].xsgs || list[i].xsgs=="1" ){
                if(j%2!=0){
                j=0;
                }
                }else{
                j++;
                }
                }#>

                </tbody>
                <#if(!isGroup){ #>
            </table>
            <#}#>
</script>

<!-- 二级表单  原默认方式-->
<script id="formSecondChild" type="text/html">
    <table class="form-table-child" >
        <tr>
            <td class="form-lable td-title" colspan="4">
                <span class="form-td-title-circle">
                    <%--<i class="fa fa-circle" aria-hidden="true"></i>--%>
                </span>
                <#=formInfo.name#>
            </td>
        </tr>
    </table>
    <table class="form-table form-table-child" form-table-name="<#=formInfo.dynatable#>" ng-class="{'disabled':isView||isReadOnly}" >
        <thead>
        <tr>
            <#
            var childForm = formInfo.child;
            for(var i=0;i<childForm.length;i++){
            if(childForm[i].isshow == '0'){
            continue;
            }
            if(childForm[i].resovletype == 'default'){
            continue;
            }
            if(childForm[i].resovletype == 'platform4'){
            continue;
            }
            if(childForm[i].isListCloum == "1"){
            #>
            <th>
                <#-childForm[i].must == '1' ? "<i class='pd-required'>*</i>" : ""#>
                <#if(childForm[i].explain){#>
                <power-tip position="left" icon="fa fa-info-circle" content="<#=childForm[i].explain#>" size="1"></power-tip>
                <#}#>
                <#=childForm[i].label#>
            </th>
            <#}
            }
            #>
            <#if(childForm.length >= MAX_CHILD_COLUMN){
            #>
            <th>...</th>
            <#
            }#>
            <th class="childItem-module-pointer-btn-1" ng-if="!isView&&!isReadOnly">操作</th>
        </tr>
        </thead>
        <tbody>
        <tr ng-repeat="childItem in dynamic.<#=formInfo.dynatable#>">
            <#
            var childForm = formInfo.child;
            var childFormStr = JSON.stringify(formInfo);
            for(var i=0;i<childForm.length;i++){
            if(childForm[i].isshow == '0'){
            continue;
            }
            if(childForm[i].resovletype == 'default'){
            continue;
            }
            if(childForm[i].isListCloum == "1"){
            childForm[i].isChildItem = true;
            #>
            <td>
                <!-- 开始解析组件 -->
                <#if(childForm.length >= MAX_CHILD_COLUMN){#>
                <div class="pointer childItem-module-pointer"
                     ng-click="ctrl.events.addChildTableRow('<#=formInfo.dynatable#>',<#=childForm.length#>,'<#=childFormStr#>',$index)"
                     ng-bind="childItem.<#=childForm[i].dbcolum#>"></div>
                <#}else{#>
                <#-dynamicResolver.commpResolver(childForm[i])#>
                <#}#>
                <!-- 结束解析组件 -->
            </td>
            <#
            }
            }
            #>
            <#if(childForm.length >= MAX_CHILD_COLUMN){
            #>
            <td class="pointer childItem-module-pointer-btn-2"
                ng-click="ctrl.events.addChildTableRow('<#=formInfo.dynatable#>',<#=childForm.length#>,'<#=childFormStr#>',$index)">...</td>
            <#
            }#>
            <td ng-if="!isView&&!isReadOnly">
                <span class="form-table-child-opt add pointer" ng-click="ctrl.events.addChildTableRow('<#=formInfo.dynatable#>',<#=childForm.length#>,'<#=childFormStr#>')">
                    <i class="fa fa-plus-square" aria-hidden="true"></i>
                    新增
                </span>
                <span ng-if="<#=childForm.length >= MAX_CHILD_COLUMN#>" >|</span>
                <span ng-if="<#=childForm.length >=MAX_CHILD_COLUMN#>" class="form-table-child-opt add pointer" ng-click="ctrl.events.addChildTableRow('<#=formInfo.dynatable#>',<#=childForm.length#>,'<#=childFormStr#>',$index)">
                    <i class="fa fa-pencil" aria-hidden="true"></i>
                    编辑
                </span>
                <span>|</span>
                <span class="form-table-child-opt add pointer"   ng-click="ctrl.events.copyChildTableRow('<#=formInfo.dynatable#>',$index)">
                    <i class="fa fa-clone" aria-hidden="true"></i>
                    复制
                </span>
                <span ng-if="dynamic.<#=formInfo.dynatable#>.length>1">|</span>
                <span class="form-table-child-opt del pointer"  ng-if="dynamic.<#=formInfo.dynatable#>.length>1" ng-click="ctrl.events.delChildTableRow('<#=formInfo.dynatable#>',$index)">
                    <i class="fa fa-minus-square" aria-hidden="true"></i>
                    删除
                </span>

            </td>
        </tr>
        </tbody>
    </table>
</script>
<!-- 二级表单  基础平台4方式-->
<script id="platform4SecondChild" type="text/html">
    <div class="row" ng-init="dynatable='<#=formInfo.dynatable#>'">
        <div class="col-md-12" >
            <#
            var formInfoClone = $.extend({},formInfo);
            var childObjs =formInfoClone.child;
            for(var index=0;index<childObjs.length;index++){
            var childObj = childObjs[index];
            childObj.ysdymb = '';
            childObj.yddysdymb = '';
            childObj.pbdysdymb = '';
            }
            var childForm = formInfo.child;
            var tableHead = formInfo.tableHead;
            var headtrs = tableHead.length?tableHead.length:1;
            var childFormStr = JSON.stringify(formInfoClone); #>
            <table ng-if="!<#=formInfo.dynatable#>&&<#=formInfo.isshow#>" class="form-table-child form-table-title-<#=formInfo.dynatable#>" >
                <tr>
                    <td class="form-lable td-title" colspan="4">
                        <#if(formInfo.BTNR){#>
                        <span class="form-td-title-circle">
                </span>
                        <#  }#>
                        <#=formInfo.BTNR#>
                        <#if(formInfo.YSSM){#>
                        <power-tip position="left"  icon="fa fa-info-circle" content="<#=formInfo.YSSM#>" size="1"></power-tip>
                        <#  }#>

                        <span></span>
                        <button ng-if="!isView&&!isReadOnly" ng-show="childFormBtnIsShow" type="button" class="btn btn-default btn-lg add" ng-click="addLastLine('<#=formInfo.dynatable#>','<#=childFormStr#>')" style="float:right;">增&nbsp;加</button>
                        <#if(formInfo.SFDX=='true'){#>
                        <button ng-if="!isView&&!isReadOnly" ng-show="childFormBtnIsShow" type="button" class="btn btn-default btn-sm delete" style="float:right;margin-right:10px;" ng-click="deleteSelectRows('<#=formInfo.dynatable#>')">移除选中</button>
                        <#  }#>
                    </td>
                </tr>
            </table>

            <%--可编辑子表-------开始--%>
            <form ng-if="!<#=formInfo.dynatable#>&&<#=formInfo.isshow#>" id="platform4SecondChildform-<#=formInfo.dynatable#>" class="pt-border-line form-horizontal" role="form" novalidate
                  name="validateForm" edit-table-son>
                <table ng-if="!<#=formInfo.dynatable#>&&<#=formInfo.isshow#>" class="table pt-edit-table form-table-<#=formInfo.dynatable#>"  form-table-name="<#=formInfo.dynatable#>" style="width: 100%">
                    <thead>
                    <tr class="DHBT" style="   "  >
                        <#if(formInfo.SFDX=='true'){#>
                        <th style=" vertical-align: middle;width: 5%;" class="center" ng-if="!isView&&!isReadOnly" ng-show="childFormBtnIsShow" rowspan="<#=headtrs#>">
                            <input  class="magic-checkbox" type="checkbox" name="editTableSelectAll" ng-checked="editTableSelectAll" id="<#=formInfo.dynatable#>_editTableSelectAll"
                                    ng-model="editTableSelectAll" ng-value="true"  ng-change="checkAllItem('<#=formInfo.dynatable#>')">
                            <label  style="margin-top: -25px" for="<#=formInfo.dynatable#>_editTableSelectAll"></label>
                        </th>
                        <#  }#>
                        <#

                        if(tableHead){
                        var tr = tableHead[0].tr;
                        if(tr){
                        for(var i=0;i<tr.length;i++){
                        var thconfig = tr[i];
                        #>
                        <#if(childForm[i].type =='LATITUDE_LONGITUDE_ELEMENT'){#>
                        <th class="center <#=thconfig.colName#>_labelTh form-lable" rowspan="<#=thconfig.rowspan#>" colspan="<#=thconfig.colspan#>"  style=" vertical-align: middle;"   width="50px" ng-class="{'disabled':isView||isReadOnly}" >
                            <span style = 'color : red;' class="ng-hide" ng-hide="isShowColum" ><#=(thconfig.colName).toLowerCase() #></span><#=thconfig.label#>
                        </th>
                        <#}else{#>
                        <th class="center <#=thconfig.colName#>_labelTh form-lable" rowspan="<#=thconfig.rowspan#>" colspan="<#=thconfig.colspan#>"  style=" vertical-align: middle;" <#if(thconfig.width){#> width="<#=thconfig.width#>" <#}#> ng-class="{'disabled':isView||isReadOnly}" >
                            <span style = 'color : red;' class="ng-hide" ng-hide="isShowColum" ><#=(thconfig.colName).toLowerCase() #></span><#=thconfig.label#>
                        </th>
                        <#}#>


                        <#  }
                        }
                        }
                        else{

                        for(var i=0;i<childForm.length;i++){
                        if(childForm[i].isshow == '0'){
                        continue;
                        }
                        if(childForm[i].resovletype == 'default'){
                        continue;
                        }
                        #>

                        <#if(childForm[i].type =='LATITUDE_LONGITUDE_ELEMENT'){#>
                        <th class="center <#=childForm[i].dbcolum#>_labelTh form-lable"  ng-class="{'disabled':isView||isReadOnly}" width="50px">
                            <span style = 'color : red;' class="ng-hide" ng-hide="isShowColum" ><#=(childForm[i].dbcolum).toLowerCase()#></span>
                            <#-childForm[i].must == '1' ? "<i class='pd-required'>*</i>" : ""#>
                            <#=childForm[i].label#>
                        </th>
                        <#}else{#>
                        <th class="center <#=childForm[i].dbcolum#>_labelTh form-lable" <#if(childForm[i].table_head_width){#> width="<#=childForm[i].table_head_width#>" <#}#> ng-class="{'disabled':isView||isReadOnly}">
                        <span style = 'color : red;' class="ng-hide" ng-hide="isShowColum" ><#=(childForm[i].dbcolum).toLowerCase()#></span>
                        <#-childForm[i].must == '1' ? "<i class='pd-required'>*</i>" : ""#>
                        <#=childForm[i].label#>
                        </th>
                        <#}#>
                        <#
                        }
                        }
                        #>


                        <th style=" vertical-align: middle;width: 5%;" title="增加" class="center" ng-if="!isView&&!isReadOnly" ng-show="childFormBtnIsShow" rowspan="<#=headtrs#>">
                            操作
                        </th>
                        <#if(childForm.length > MAX_CHILD_COLUMN){
                        #>
                        <th rowspan="<#=headtrs#>" style=" vertical-align: middle;">...</th>
                        <#
                        }#>
                    </tr>

                    <#
                    if(tableHead){
                    for(var j=1;j<tableHead.length;j++){
                    var tr = tableHead[j].tr;
                    if(tr){
                    #>
                    <tr>
                        <#          for(var i=0;i<tr.length;i++){
                        var thconfig = tr[i];
                        #>

                        <#if(childForm[i].type =='LATITUDE_LONGITUDE_ELEMENT'){#>
                        <th class="center <#=thconfig.colName#>_labelTh form-lable" rowspan="<#=thconfig.rowspan#>" colspan="<#=thconfig.colspan#>" ng-class="{'disabled':isView||isReadOnly}" width="50px">
                            <#=thconfig.label#>
                        </th>
                        <#}else{#>
                        <th class="center <#=thconfig.colName#>_labelTh form-lable" rowspan="<#=thconfig.rowspan#>" colspan="<#=thconfig.colspan#>" ng-class="{'disabled':isView||isReadOnly}" <#if(thconfig.width){#> width="<#=thconfig.width#>" <#}#> >
                            <#=thconfig.label#>
                        </th>
                        <#}#>

                        <#
                        }
                        }
                        }#>
                    </tr>
                    <#  }#>

                    </thead>
                    <tbody>
                    <tr  ng-repeat="childItem in dynamic.<#=formInfo.dynatable#>" on-finish-render-filters
                         class="editTableRows_{{$index}}" ng-dblclick="changeToEdit($index)">
                        <#if(formInfo.SFDX=='true'){#>
                        <td ng-if="!isView&&!isReadOnly" ng-show="childFormBtnIsShow" class="center">
                            <input class="magic-checkbox platform4-SecondChildform-magic-checkbox" type="checkbox" name="{{$index}}_checkbox" id="<#=formInfo.dynatable#>_{{$index}}_checkbox"
                                   ng-model="item.checked" ng-value="true" ng-click="selectedRow($event,$index,'<#=formInfo.dynatable#>')">
                            <label for="<#=formInfo.dynatable#>_{{$index}}_checkbox"></label>
                        </td>
                        <#  }#>
                        <#
                        var childForm = formInfo.child;
                        var childFormStr = JSON.stringify(formInfo);
                        for(var i=0;i<childForm.length;i++){
                        childForm[i].isChildItem = true;
                        if(childForm[i].isshow == '0'){
                        continue;
                        }
                        if(childForm[i].resovletype == 'default'){
                        continue;
                        }
                        #>
                        <#if(childForm[i].type =='LATITUDE_LONGITUDE_ELEMENT'){#>
                        <td class="<#=childForm[i].dbcolum#>_valueTd" style="vertical-align: middle;" width="50px">
                            <#}else{#>
                        <td class="<#=childForm[i].dbcolum#>_valueTd" style="vertical-align: middle;" class="<#=childForm[i].dbcolum#>">
                            <#}#>
                            <!-- 开始解析组件 -->
                            <#if(childForm.length >= MAX_CHILD_COLUMN){#>
                            <div class="pointer childItem-module-pointer"
                                 ng-click="ctrl.events.addChildTableRow('<#=formInfo.dynatable#>',<#=childForm.length#>,'<#=childFormStr#>',$index)"
                                 ng-bind="childItem.<#=childForm[i].dbcolum#>"></div>
                            <#}else{#>

                            <div elementid="<#=childForm[i].id#>"  form-table-name="<#=formInfo.dynatable#>" index="{{$index}}"  class="child-form-element{{$index}}-<#=i#> <#if(childForm[i].bootstrap_col&&childForm[i].bootstrap_col!='empty'){#><#=childForm[i].bootstrap_col #><#}#>">
                                <#-dynamicResolver.commpResolver(childForm[i])#>
                            </div>
                            <#}#>
                            <!-- 结束解析组件 -->
                        </td>
                        <#
                        }
                        #>
                        <td ng-if="!isView&&!isReadOnly" ng-show="childFormBtnIsShow&&!childItem.childFormBtnIsHide"  style="line-height: 35px;vertical-align: middle;text-align: center;position: relative" ng-mouseover="showOtherBtns = true" ng-mouseleave="showOtherBtns = false" ng-init="showOtherBtns = false">
                            <button  type="button" class="btn btn-default btn-sm delete" style="margin-right: 8px;margin-left: 8px;"  ng-click="ctrl.events.delChildTableRow('<#=formInfo.dynatable#>',$index)">移&nbsp;除</button>
                        </td>
                        <#if(childForm.length > MAX_CHILD_COLUMN){
                        #>
                        <th >...</th>
                        <#
                        }#>
                    </tr>
                    </tbody>
                </table>
            </form>
            <%--可编辑子表-------结束--%>
        </div>
    </div>
</script>
<!-- 普通子表表单解析部分 -->
<script id="commonFormChild" type="text/html">
    <#
    var formInfoClone = $.extend({},formInfo);
    var childObjs =formInfoClone.child;
    for(var index=0;index<childObjs.length;index++){
    var childObj = childObjs[index];
    childObj.ysdymb = '';
    childObj.yddysdymb = '';
    childObj.pbdysdymb = '';
    }
    var childForm = formInfo.child;
    var tableHead = formInfo.tableHead;
    var headtrs = tableHead.length?tableHead.length:1;
    var childFormStr = JSON.stringify(formInfoClone); #>
    <table ng-if="!<#=formInfo.dynatable#>"  class="form-table-child form-table-title-<#=formInfo.dynatable#>" >
        <tr>
            <td class="form-lable td-title" colspan="4">
                <span class="form-td-title-circle"></span>
                <#=formInfo.name#>
                <button style="float:right;" ng-hide="dynamic.<#=formInfo.dynatable#>.length>0"  ng-if="!isView&&!isReadOnly" type="button" class="btn btn-default btn-lg add" ng-click="addLastLine('<#=formInfo.dynatable#>','<#=childFormStr#>')">增&nbsp;加</button>
            </td>
        </tr>
    </table>
    <table ng-if="!<#=formInfo.dynatable#>" ng-repeat="childItem in dynamic.<#=formInfo.dynatable#>"  class="form-table form-table-<#=formInfo.dynatable#>"   form-table-name="<#=formInfo.dynatable#>" ng-class="{'disabled':isView||isReadOnly}" >
        <tbody>
        <tr >
            <td colspan="4" ng-if="!isView&&!isReadOnly" ng-show="childFormBtnIsShow&&!childItem.childFormBtnIsHide"  style="line-height: 35px;vertical-align: middle;text-align: right;position: relative" ng-mouseover="showOtherBtns = true" ng-mouseleave="showOtherBtns = false" ng-init="showOtherBtns = false">
                <button   type="button" class="btn btn-default btn-lg add" ng-click="addLastLine('<#=formInfo.dynatable#>','<#=childFormStr#>')">增&nbsp;加</button>
                <button  type="button" class="btn btn-default btn-sm delete" style="margin-right: 8px;margin-left: 8px;"  ng-click="ctrl.events.delChildTableRow('<#=formInfo.dynatable#>',$index)">移&nbsp;除</button>
            </td>
        </tr>
        <#
        //j是用来遍历结构的
        var j = 0;
        var  list  =  formInfo.child;
        for(var i=0;i<list.length;i++){
        list[i].isChildItem=true
        if(list[i].isshow == '0'){
        continue;
        }
        //标题类型
        if(list[i].type == 'TITLE_ELEMENT'
        ){
        #>
        <tr>
            <td width="{{FORM_LABEL_WIDTH}}" class="form-lable td-title"  colspan="4" name="<#=list[i].YSMC #>">
                                <span class="form-td-title-circle">
                                </span>
                <#=list[i].label #>
            </td>
        <tr>
            <#
            continue;
            }
            #>
            <!-- 显示格式 -->
            <#if(!list[i].xsgs || list[i].xsgs=="1" || (list[i].xsgs =="2" && j%2==0)){ #><!-- 显示格式 -->
        <tr>
            <#}#>
            <!-- 提示 -->
            <#if( (list[i].ISSHOWLABEL&&'true'==list[i].ISSHOWLABEL)
            ){
            #>

            <td width="{{FORM_LABEL_WIDTH}}" ng-hide="<#=list[i].rowspans>1#>" class="form-lable <#=list[i].dbcolum+'_labelTh'#>"   ng-class="{'disabled':<#=list[i].readonly=='1'#>}">
                <#-list[i].must&&list[i].must=='1' ? "<i class='pd-required'>*</i>" : "" #>
                <!- 提示框 ->
                <#if(list[i].explain){#>
                <power-tip position="left" icon="fa fa-info-circle" content="<#=list[i].explain#>" size="1"></power-tip>
                <#}#>
                <span style = 'color : red;' class="ng-hide" ng-hide="isShowColum" ><#=(list[i].dbcolum).toLowerCase() #></span><#=list[i].label #>：
            </td>
            <#
            }
            #>
            <!-- 描述组件默认不显示label -->
            <#
            if(  (list[i].ISSHOWLABEL&&'true'==list[i].ISSHOWLABEL)
            ){
            #>
            <td  <#if(list[i].xsgs && (list[i].xsgs =="2")){#> width="{{FORM_ELEMENT_WIDTH}}" <#}#>
            align="<#=list[i].ALIGN#>" <#-list[i].rowspans>1 ? "rowspan="+list[i].rowspans : "" #> class="<#=list[i].dbcolum+'_valueTd' #>" <#if(!list[i].xsgs || list[i].xsgs=="1"){ #>colspan="7" <#}else if(list[i].xsgs=="2"){#>colspan="3" <#}else{#>colspan="1" <#}#> >

            <#}
            else {
            #>
            <td  align="<#=list[i].ALIGN#>" <#-list[i].rowspans>1 ? "rowspan="+list[i].rowspans : "" #> class="<#=list[i].dbcolum+'_valueTd' #>" <#if(!list[i].xsgs || list[i].xsgs=="1"){ #>colspan="8" <#}else if(list[i].xsgs=="2"){#>colspan="4" <#}else{#>colspan="2" <#}#> >
            <#
            }
            #>
            <!-- 开始解析组件 -->

            <div  class="<#if(childForm[i].bootstrap_col&&childForm[i].bootstrap_col!='empty'){#>row <#=childForm[i].bootstrap_col #><#}#>">

                <#-dynamicResolver.commpResolver(list[i])#>
            </div>
            <!-- 结束解析组件 -->
            </td>
            <#if(!list[i].xsgs || list[i].xsgs=="1" || (list[i].xsgs =="2" && j%2!=0)){#>
        </tr>
        <#}#>
        <#
        if(!list[i].xsgs || list[i].xsgs=="1" ){
        if(j%2!=0){
        j=0;
        }
        }else{
        j++;
        }#>
        <#}#>

        </tbody>
    </table>
</script>